package com.jcl.recruit.api.crawler.controller;

import com.jcl.core.common.page.PageResult;
import com.jcl.core.resp.ApiResponse;
import com.jcl.recruit.crawler.service.CrawlerAccountService;
import com.jcl.recruit.crawler.vo.CrawlerAccountParam;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName CrawlerCorpAccountController

 * @Author yyliu
 * @Date 2018/10/22 10:28
 * @Version 1.0
 **/
@RestController
@RequestMapping("/api/crawler")
public class CrawlerCorpAccountController {

    @Autowired
    private CrawlerAccountService crawlerAccountService;


    @RequestMapping(value = "/corp/account", method = {RequestMethod.POST})
    public ApiResponse saveResume(@RequestBody CrawlerAccountParam param){

        if(StringUtils.isEmpty(param.getSource())){
            return ApiResponse.error(" param 'source' is lose!");
        }
        PageResult data = crawlerAccountService.crawlerAccount(param);
        return ApiResponse.success(data);
    }


}
